package cn.huiyunche.base.service.form;

import cn.huiyunche.base.service.constant.RegularConstant;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @FileName: cn.huiyunche.base.service.form
 * @Description: 车型类型表单
 * @author: Aaron
 * @date: 2017/2/27 上午10:10
 */
public class BVehicleTypeForm {

    private Long id;

    //类型编码
    @NotBlank(message = "类型编码不能为空")
    @Pattern(regexp = RegularConstant.letter_number, message = "只能输入数字或字母")
    @Max(value = 50, message = "编码长度不能大于50位")
    private String typeCode;

    //类型名称
    @NotBlank(message = "类型名称不能为空")
    private String typeName;

    //驾照类型
    @NotNull(message = "请选择驾照类型")
    @Min(value = 1, message = "驾照类型主键不能小于0")
    private String licenseType;

    //描述
    private String descripition;

    //燃油类型主键
    @NotNull(message = "请选择燃油类型")
    @Min(value = 1, message = "燃油类型主键不能小于0")
    private Integer fuelTypeId;

    //百公里油耗
    @NotNull(message = "百公里油耗不能为空")
    @DecimalMin(value = "0.01", message = "百公里油耗不能小于0")
    @Pattern(regexp = RegularConstant.number_decimals, message = "百公里油耗只能输入正数")
    private BigDecimal fuelConsumption;

    //创建时间
    private Date createTime;

    //创建人
    private String createor;

    //更新时间
    private Date updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTypeCode() {
        return typeCode;
    }

    public void setTypeCode(String typeCode) {
        this.typeCode = typeCode;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getLicenseType() {
        return licenseType;
    }

    public void setLicenseType(String licenseType) {
        this.licenseType = licenseType;
    }

    public String getDescripition() {
        return descripition;
    }

    public void setDescripition(String descripition) {
        this.descripition = descripition;
    }

    public Integer getFuelTypeId() {
        return fuelTypeId;
    }

    public void setFuelTypeId(Integer fuelTypeId) {
        this.fuelTypeId = fuelTypeId;
    }

    public BigDecimal getFuelConsumption() {
        return fuelConsumption;
    }

    public void setFuelConsumption(BigDecimal fuelConsumption) {
        this.fuelConsumption = fuelConsumption;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreateor() {
        return createor;
    }

    public void setCreateor(String createor) {
        this.createor = createor;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "BVehicleTypeForm{" +
                "id=" + id +
                ", typeCode='" + typeCode + '\'' +
                ", typeName='" + typeName + '\'' +
                ", licenseType='" + licenseType + '\'' +
                ", descripition='" + descripition + '\'' +
                ", fuelTypeId=" + fuelTypeId +
                ", fuelConsumption=" + fuelConsumption +
                ", createTime=" + createTime +
                ", createor='" + createor + '\'' +
                ", updateTime=" + updateTime +
                '}';
    }
}
